home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple II Magazines (PO)
/
Nibble Volume 11, No. 10 (1990-10)(MindCraft Publishing)(Side A)[a].zip
/
Nibble Volume 11, No. 10 (1990-10)(MindCraft Publishing)(Side A)[a].po
/
READ80.S
< prev
next >
Wrap
Text File
|
1996-12-24
|
4KB
|
80 lines
********************************
l
l
l
* READ80 Source Code *
* By Rudy A. Guy *
* Copyright (c) 1990 *
* MindCraft Publishing Corp. *
* Concord, MA 01742 *
********************************
* *
* MindCraft Assembler *
* *
********************************
ORG $801 ;origin
MAIN_MEM EQU $C054 ;80 column softswitch
AUX_MEM EQU $C055 ;80 column softswitch
LINE1 EQU $531 ;memory location of 1st line of input
LINE2 EQU $5B1 ;memory location of 2nd line of input
LINE3 EQU $631 ;memory location of 3rd line of input
BLD_STR EQU $801 ;move screen memory here
DFS $B5 ;reserve 180 bytes
START LDX #$00
LDA #$20 ;put a space character into acc.
CLEAR STA BLD_STR,X ;put space into reserved memory
INX
CPX #$B4 ;All 180 bytes filled with spaces?
BNE CLEAR ;If not - continue
LDX #$00
LDY #$00
READ_60 BIT AUX_MEM ;prepare to read from aux. screen memory
LDA LINE1,Y ;read a character from screen
STA BLD_STR,X ;move character to reserved memory
BIT MAIN_MEM ;prepare to read from main screen memory
LDA LINE1,Y ;read a character from screen
INX ;increment pointer to reserved memory
STA BLD_STR,X ;move character to reserved memory
INX ;increment pointer to reserved memory
INY ;increment the number of screen reads
CPY #$1E ;All of the line read?
BEQ NEXT_60 ;If 60 characters read then do next line
JMP READ_60 ;Continue reading this line
NEXT_60 LDY #$00 ;Initialize counter for second line
READ_120 BIT AUX_MEM ;prepare to read from aux. text screen
LDA LINE2,Y ;read a character
STA BLD_STR,X ;move it to reserved bytes
BIT MAIN_MEM ;prepare to read from main text screen
LDA LINE2,Y ;read a character
INX ;increment pointer to reserved bytes
STA BLD_STR,X ;move character to reserved bytes
INX ;increment pointer to reserved bytes
INY ;increment the number of screen reads
CPY #$1E ;done reading?
BEQ FINAL_60 ;if yes - read final 60 characters
JMP READ_120 ;continue reading current line
FINAL_60 LDY #$00 ;initialize counter for final reads
READ_180 BIT AUX_MEM ;prepare to read from aux. text screen
LDA LINE3,Y ;read a character
STA BLD_STR,X ;move character to reserved memory
BIT MAIN_MEM ;prepare to read from main text screen
LDA LINE3,Y ;read a character
INX ;increment pointer to reserved memory bytes
STA BLD_STR,X ;store character in reserved memory
INX ;increment pointer to reserved memory bytes
INY ;increment the number of reads performed
CPY #$1E ;done?
BEQ DONE ;if yes - exit read routine
JMP READ_180 ;continue reading current line
DONE LDX #$00 ;prepare to move reserved bytes to string loc.
MOVE_IT LDA BLD_STR,X ;get 1st character from reserved memory
SEC ;set carry
SBC #$80 ;subtract 128 from character code
DFC $9D,$00,$00 ;move character to locations poked from BASIC
INX ;increment counter
CPX #$B4 ;all characters moved?
BEQ END ;if yes - exit move routine
JMP MOVE_IT ;continue moving characters
END RTS ;back to BASIC
q